import request from '@/utils/request'

// 查询字典类型列表
export function listType(data) {
  return request({
    url: '/system/dict/type/query',
    method: 'post',
    data,
  })
}

// 根据字典dict_Id查询字典类型
export function getType(dictId) {
  return request({
    url: '/system/dict/type/query',
    method: 'post',
    data: { dictId },
  })
}

// 新增字典类型
export function addType(data) {
  return request({
    url: '/system/dict/type/add',
    method: 'post',
    data,
  })
}

// 修改字典类型
export function updateType(data) {
  return request({
    url: '/system/dict/type/update',
    method: 'post',
    data,
  })
}

// 删除字典类型
export function delType(dictId) {
  return request({
    url: `/system/dict/type/delete${ dictId }`,
    method: 'delete',
  })
}

// 清理参数缓存
export function clearCache() {
  return request({
    url: '/system/dict/type/clearCache',
    method: 'delete',
  })
}

// 获取字典选择框列表
export function optionselect() {
  return request({
    url: '/system/dict/data/selectDictDataList',
    method: 'post',
  })
}

// 获取用户下拉框
export function selectUser(params) {
  return request({
    url: '/system/user/selectUserDropDownBox',
    method: 'get',
    params,
  })
}